package com.whmskj.xjlhsc.qianYiData.service.impl;

import com.whmskj.xjlhsc.qianYiData.mapper.AMonthlyAverageTonOfGauzeConsumpMapper;
import com.whmskj.xjlhsc.qianYiData.service.AMonthlyAverageTonOfGauzeConsumpService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.time.LocalDate;
import java.time.ZoneId;
import java.util.Date;

@Service
public class AMonthlyAverageTonOfGauzeConsumpServiceImpl implements AMonthlyAverageTonOfGauzeConsumpService {

    @Resource
    private AMonthlyAverageTonOfGauzeConsumpMapper mapper;

    @Override
    public int syncForDay(LocalDate day) {
        Date d = Date.from(day.atStartOfDay(ZoneId.systemDefault()).toInstant());
        return mapper.upsertForDay(d);
    }
}

